package com.ruoyi.ora.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ora.mapper.TransactionMapper;
import com.ruoyi.ora.domain.Transaction;
import com.ruoyi.ora.service.ITransactionService;

/**
 * 用户交易Service业务层处理
 * 
 * @author liuwp
 * @date 2024-11-14
 */
@Service
public class TransactionServiceImpl implements ITransactionService 
{
    @Autowired
    private TransactionMapper transactionMapper;

    /**
     * 查询用户交易
     * 
     * @param id 用户交易主键
     * @return 用户交易
     */
    @Override
    public Transaction selectTransactionById(Long id)
    {
        return transactionMapper.selectTransactionById(id);
    }

    /**
     * 查询用户交易列表
     * 
     * @param transaction 用户交易
     * @return 用户交易
     */
    @Override
    public List<Transaction> selectTransactionList(Transaction transaction)
    {
        return transactionMapper.selectTransactionList(transaction);
    }

    /**
     * 根据业务主键查询一条记录：用户交易
     *
     * @param transaction 用户交易
     * @return 用户交易
     */
    @Override
    public Transaction selectOneTransaction(Transaction transaction)
    {
        return transactionMapper.selectOneTransaction(transaction);
    }

    /**
     * 新增用户交易
     * 
     * @param transaction 用户交易
     * @return 结果
     */
    @Override
    public int insertTransaction(Transaction transaction)
    {
        transaction.setCreateTime(DateUtils.getNowDate());
        return transactionMapper.insertTransaction(transaction);
    }

    /**
     * 修改用户交易
     * 
     * @param transaction 用户交易
     * @return 结果
     */
    @Override
    public int updateTransaction(Transaction transaction)
    {
        return transactionMapper.updateTransaction(transaction);
    }

    @Override
    public int updateTransactionCondition(Transaction transaction, Transaction transactionCondition)
    {
        return transactionMapper.updateTransactionCondition(transaction, transactionCondition);
    }

    /**
     * 批量删除用户交易
     * 
     * @param ids 需要删除的用户交易主键
     * @return 结果
     */
    @Override
    public int deleteTransactionByIds(Long[] ids)
    {
        return transactionMapper.deleteTransactionByIds(ids);
    }

    /**
     * 删除用户交易信息
     * 
     * @param id 用户交易主键
     * @return 结果
     */
    @Override
    public int deleteTransactionById(Long id)
    {
        return transactionMapper.deleteTransactionById(id);
    }

    /**
     * 条件删除用户交易
     *
     * @param transaction 用户交易
     * @return 结果
     */
    @Override
    public int deleteTransactionByCondition(Transaction transaction)
    {
        return transactionMapper.deleteTransactionByCondition(transaction);
    }

}
